package com.example.controller;

import com.example.service.ExamService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/exam")
public class ExamController {
    @Autowired
    private ExamService examService;

    @GetMapping("/evaluate")
    public ResponseEntity<?> evaluateCandidate(
            @RequestParam String major,
            @RequestParam int score,
            @RequestParam String mathType,
            @RequestParam String englishType) {
        return ResponseEntity.ok(examService.evaluate(major, score, mathType, englishType));
    }
}

